/**   
 * Copyright © 2018 Zuxia. Tech Ltd. All rights reserved.
 * 
 * @Package: com.java46.struts2.base.http 
 * @author: zuxia   
 * @date: 2018年7月4日 上午10:51:07 
 */
package com.java46.struts2.base.http;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

/** 
 * @ClassName: HttpRequestWrapper 
 * @Description: request对象的包装类
 * @author: zuxia
 * @date: 2018年7月4日 上午10:51:07 
 */
public class HttpRequestWrapper extends HttpServletRequestWrapper {

	private HttpServletRequest request;
	
	public HttpRequestWrapper(HttpServletRequest request) {
		super(request);
		this.request = request;
	}
	
	@Override
	public String getParameter(String name) {
		String value = request.getParameter(name);
		try {
			byte[] bytes = value.getBytes("ISO-8859-1");
			value = new String(bytes, "UTF-8");
		} catch (UnsupportedEncodingException e) {
		}
		return value;
	}
	

}
